﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Extensil.Common;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace WSPCreator
{
    [Extensil.Common.CategoryAttribute("Test Category")]
    public partial class UserInput :BaseCategory
    {
        public UserInput()
        {
            InitializeComponent();
        }

        private void btnTakeUpdate_Click(object sender, EventArgs e)
        {
           // Uri tfs08Uri = new Uri("http://Sww-Sede-team.shell.com");
            //Uri tfs08Uri = new Uri("https://sww-sede-sharing.shell.com/PTSSW/WRFM");   
            ////sww-sede-team.shell.com/PTSSW/WRFM
            ////https://sww-sede-sharing.shell.com/PTSSW/WRFM
            //TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(tfs08Uri);
            //var vcServer = tpc.GetService<VersionControlServer>();
            //Workspace myWorkspace = vcServer.GetWorkspace("workspaceName", "workspaceOwner");


            string serverName = "https://sww-sede-sharing.shell.com/PTSSW/WRFM";
            TeamFoundationServer tfs = new TeamFoundationServer(serverName);
            VersionControlServer version = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
            Workspace workspace = version.GetWorkspace("WRFM", version.AuthenticatedUser);
            AlertBox.ShowDialog(workspace.Name);
            //TeamFoundationServer server = new TeamFoundationServer("");
            //server.
        }
    }
}
